home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 August / ENTER.ISO / files / gimp-2.0.5-i586-setup.exe / {app} / share / gimp / 2.0 / scripts / land.scm < prev    next >
Encoding:
Text File  |  2004-09-26  |  3.0 KB  |  85 lines

  1. ; The GIMP -- an image manipulation program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ; Land --- create a pattern that resembles a Topographic map
  4. ; Copyright (C) 1997 Adrian Karstan Likins
  5. ; aklikins@eos.ncsu.edu
  6. ;
  7. ;      This script works on the current gradient you have loaded. 
  8. ;      Some suggested gradients: 
  9. ;            Land                  (produces a earthlike map)
  10. ;            Brushed_aluminum      (looks like the moon)
  11. ;  
  12. ;
  13. ; Thanks to Quartic for helping me debug this thing. 
  14. ;
  15. ; This program is free software; you can redistribute it and/or modify
  16. ; it under the terms of the GNU General Public License as published by
  17. ; the Free Software Foundation; either version 2 of the License, or
  18. ; (at your option) any later version.
  19. ; This program is distributed in the hope that it will be useful,
  20. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. ; GNU General Public License for more details.
  23. ; You should have received a copy of the GNU General Public License
  24. ; along with this program; if not, write to the Free Software
  25. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  26.  
  27.  
  28.  
  29. (define (script-fu-land width height seed detail landheight seadepth xscale yscale gradient)
  30.   (let* (
  31.      (img (car (gimp-image-new width height RGB)))
  32.      (layer-one (car (gimp-layer-new img width height
  33.                      RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
  34.     )
  35.   (gimp-gradients-set-gradient gradient)
  36.   (gimp-image-undo-disable img)
  37.   (gimp-image-add-layer img layer-one 0)
  38.  
  39.   (plug-in-solid-noise 1 img layer-one TRUE FALSE seed detail xscale yscale)
  40.   (plug-in-c-astretch 1 img layer-one)
  41.   (set! layer-two (car (gimp-layer-copy layer-one TRUE)))
  42.   (gimp-image-add-layer img layer-two -1)
  43.   (gimp-image-set-active-layer img layer-two)
  44.  
  45.   (plug-in-gradmap 1 img layer-two)
  46.  
  47.  
  48.  
  49.   (gimp-by-color-select layer-one '(190 190 190) 55 CHANNEL-OP-REPLACE FALSE FALSE 0 FALSE)
  50.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
  51.  
  52.   ;(plug-in-c-astretch 1 img layer-two)
  53.   (gimp-selection-invert img)
  54.   (plug-in-bump-map 1 img layer-two layer-one 135.0 35 seadepth 0 0 0 0 TRUE FALSE 0)
  55.  
  56.   ;(plug-in-c-astretch 1 img layer-two)
  57.  
  58.   ; uncomment the next line if you want to keep a selection of the "land"
  59.   (gimp-selection-none img)
  60.  
  61.   (gimp-display-new img)
  62.   (gimp-image-undo-enable img)
  63. ))
  64.  
  65. (script-fu-register "script-fu-land"
  66.             _"<Toolbox>/Xtns/Script-Fu/Patterns/_Land..."
  67.             "A Topgraphic map pattern"
  68.             "Adrian Likins <aklikins@eos.ncsu.edu>"
  69.             "Adrian Likins"
  70.             "1997"
  71.             ""
  72.             SF-ADJUSTMENT _"Image Width" '(256 10 1000 1 10 0 1)
  73.             SF-ADJUSTMENT _"Image Height" '(256 10 1000 1 10 0 1)
  74.             SF-ADJUSTMENT _"Random Seed" '(32 0 15000000 1 10 0 1)
  75.             SF-ADJUSTMENT _"Detail Level" '(4 1 15 1 5 0 0)
  76.             SF-ADJUSTMENT _"Land Height" '(60 1 65 1 10 0 1)
  77.             SF-ADJUSTMENT _"Sea Depth" '(4 1 65 1 10 0 1)
  78.             SF-ADJUSTMENT _"Scale X" '(4 0.1 16 1 5 0.1 0)
  79.             SF-ADJUSTMENT _"Scale Y" '(4 0.1 16 1 5 0.1 0)
  80.             SF-GRADIENT   _"Gradient" "Land 1")
  81.